package com.bajiao.entity.pay.ali;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;

@Data
@ApiModel("AliPayResult")
public class AliPayResult {
    /**
     * 订单编号
     */
    @ApiModelProperty(value = "订单编号")
    private String orderNo;
    /**
     * 订单id
     */
    @ApiModelProperty(value = "订单id")
    private String orderId;
    /**
     * 支付的金额
     */
    @ApiModelProperty(value = "支付的金额")
    private BigDecimal payMoney;
    /**
     * 唤起支付宝所需数据
     */
    @ApiModelProperty(value = "唤起支付宝所需数据")
    private String result;


    public static final class AliPayResultBuilder {
        private String orderNo;
        private String orderId;
        //支付的金额
        private BigDecimal payMoney;
        //发起支付宝支付
        private String result;

        private AliPayResultBuilder() {
        }

        public static AliPayResultBuilder anAliPayResult() {
            return new AliPayResultBuilder();
        }

        public AliPayResultBuilder orderNo(String orderNo) {
            this.orderNo = orderNo;
            return this;
        }

        public AliPayResultBuilder orderId(String orderId) {
            this.orderId = orderId;
            return this;
        }

        public AliPayResultBuilder payMoney(BigDecimal payMoney) {
            this.payMoney = payMoney;
            return this;
        }

        public AliPayResultBuilder result(String result) {
            this.result = result;
            return this;
        }

        public AliPayResult build() {
            AliPayResult aliPayResult = new AliPayResult();
            aliPayResult.setOrderNo(orderNo);
            aliPayResult.setOrderId(orderId);
            aliPayResult.setPayMoney(payMoney);
            aliPayResult.setResult(result);
            return aliPayResult;
        }
    }
}
